<template>
	<view class="">
		<view class="box" v-for="(item,index) in datas" style="display: flex; justify-content: space-between; align-items: center;">
			<image :src="'http://124.93.196.45:10001/dev-api'+item.logoPic" mode="aspectFit"></image>
			<text style="font-size: 50px;">{{item.apkName}}</text>
			<view class=""></view>
			<view class=""></view>
			<view class=""></view>
			<view class=""></view>
			<view @click="xiazai(item.apkName)" style="padding:10px 5px; background-color: blue;
					border-radius: 10px; color: #fff; width: 60px; text-align: center;">更新</view>
		</view>
	</view>
</template>

<script setup>
	export default {
		data() {
			return {
				button: "",
				token: "",
				data: null,
				datas: []
			}
		},
		methods: {
			xiazai(a) {
				uni.showToast({
					title: a + "正在更新...",
					icon: "none",
					duration: 2000
				})
			}
		},
		onLoad() {
			console.log(111);
			this.datas = []
			this.data = uni.getStorageSync("data")
			for (var i = 0; i < this.data.length; i++) {
				if (this.data[i].apkName != null) {
					if (this.data[i].apkName.includes(this.button.trim())) {
						this.datas.push(this.data[i])
					}
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.fanhui {
		font-size: 30px;
		margin-left: 10px;
	}

	.text {
		width: 400px;
		padding: 5px;
		text-align: center;
		border-radius: 20px 0 0 20px;
		border: 1px solid #000;
	}
	.box {
		padding: 0px 20px;
		border: 1px solid #000;
		border-radius: 50px;
		margin: 50px;
	}

	.box image {
		width: 200px;
		margin: 0px 20px;
	}
</style>